package 力扣.二叉树相关问题.n叉树;

import java.util.ArrayList;
import java.util.List;

public class 后序遍历 {
    List<Integer> list = new ArrayList<>();
    public List<Integer> postorder(Node root) {
        if (root==null)
            return list;

        for (Node child : root.children) {
            postorder(child);
        }
        list.add(root.val);
        return list;
    }
}
